/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

/**
 *
 * @author pvhuy
 */
public class HelpController implements Controller {

    @Override
    public ModelAndView handleRequest(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
        String page = "helpPayment.jsp";
        String s = httpServletRequest.getParameter("type");
        if (s != null) {
            int iType = Integer.parseInt(s);
            switch (iType) {
                case 1:
                    page = "helpPayment.jsp";
                    break;
                case 2:
                    page = "helpShipment.jsp";
                    break;
                case 3:
                    page = "helpTime.jsp";
                    break;
                case 4:
                    page = "helpFreight.jsp";
                    break;
                case 5:
                    page = "helpRule.jsp";
                    break;                
            }
        }
        return new ModelAndView("help", "type", page);
    }
}
